//获取元素的纵坐标（相对于窗口）
export function getLeaveTop(e: any) {
	let offset = e.offsetTop;
	if (e.offsetParent !== null) offset += getLeaveTop(e.offsetParent);
	return offset;
}
//获取元素的横坐标（相对于窗口）
export function getLeaveLeft(e: any) {
	let offset = e.offsetLeft;
	if (e.offsetParent !== null) offset += getLeaveLeft(e.offsetParent);
	return offset;
}

/**
 * set dom style
 * @param {Dom} el
 * @param {Object} params
 */
export function setDomStyles(el: any, params: StringIndex) {
	const vm: HTMLElement = document.querySelector(el);
	Object.keys(params).forEach((item: any) => {
		vm.style[item] = params[item];
	});
}
